@include "reader.awk"

BEGIN {FS=","
    readerTest("../data/weather.dvs")
}
function readerTest(f,     t,x,y,ones,twos,com) {
    lines(f,t)
    split("cols,rows",ones)
    for(x in ones) print ones[x] " " t[ones[x]]
    split("use,string,class,nonclass,num,weight,heaven,max,min",twos)
    com="sort -n -k 4 -k 2 | uniq | sed 's/azq.*//' " 
    for(x in twos) 
        for(y in t[twos[x]])    {
            print "azq " y | com
            print "col " y " ---| " t["name"][y] " |------------- " | com
            print "col " y  " has " twos[x] " = [" t[twos[x]][y]"]" | com
        }
    for(x in t["col"])
        print x " = " t["col"][x]  | "sort -n -k 2"
} 
